package com.ndhutu.ee.util.http;

import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;

/**
 * @Author Shane
 * @Date 2020/4/6 18:37
 */
public class RequestUtil {

    /**
     * 获取请求中携带的结果
     * @Author Shane
     * @Date 2020/4/6 18:39
     * @param
     * @return
     */
    public static String getResult(HttpServletRequest request) throws Exception{
        BufferedReader br = request.getReader();
        StringBuilder sb = new StringBuilder();
        String line = null;
        while ((line = br.readLine()) != null){
            sb.append(line);
        }
        br.close();

        return sb.toString();
    }
}
